<?php
/*
Template Name: Print
*/
?>

<?php
	global $wp_query;
	global $post;
	$tmp_post = $post;
	$postId = 0;
	if (isset($wp_query->query_vars['printPostId']))
		$postId = $wp_query->query_vars['printPostId'];
	
	$post = get_post( $postId );
	setup_postdata($post);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
    <title>www.esfaturi.ro | <?php the_title(); ?></title>	
	<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
	<link rel="icon" type="image/png" href="<?php echo get_template_directory_uri(); ?>/styles/images/favicon.png">
	<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/styles/print.css" media="screen, print" />
	<script type="text/javascript">
		function PrintArticle(){
			window.print();
		}
	</script>
	<script type="text/javascript">
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-29864589-1']);
	  _gaq.push(['_trackPageview']);

	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	</script>
</head>
<body>
	<div id="header">
		<div id="header-logo" class="left">
			<div id="blog-title">
				<img src="http://www.esfaturi.ro/wp-content/uploads/2012/04/logo-170x56-transparent-esfaturi.ro_.png" alt="eSfaturi.ro" />
			</div>
		</div>
		<div id="header-title" class="left">
			<p><?php the_title(); ?></p>
			<span>Cele mai importante caracteristici de care trebuie sa tin cont</span>
		</div>
	</div>
	<div class="clear"></div>
	<input type="button" value="Printeaza articolul" class="button blueButton noPrint" onclick="PrintArticle()" />
	<input type="button" value="Close" class="button yellowButton noPrint" onclick="window.close()" />
	<div id="content">
		<?php the_content(); ?>
	</div>
	<div id="footer">
		www.esfaturi.ro | <?php echo get_option("esf_footer_message"); ?>
	</div>
</body>

<?php $post = $tmp_post; ?>